package day03;

public class OperDemo {
    public static void main(String[] args) {
//        System.out.println();
//        System.out.println();
//        System.out.println();
//        System.out.println();
//        System.out.println();
//        System.out.println();
//        System.out.println();
//        System.out.println();

        /*
        //演示++的单独使用
        int a =5,b=5;
        a++;//相当于a=a+1
        ++b;//相当于b=b+1
        System.out.println(a);
        System.out.println(b);
        System.out.println("-------------------");

        //演示++的被使用
        int c=5,d=5;
        int e = c++;//将c++的值（也就c本身的值）5赋值给e，同时c本身自增1变6
        int f = ++d;//将++b的值（也就b+1的值）6赋值给f，同时d本身自增1变6
        System.out.println(c);//6
        System.out.println(d);//6

        System.out.println(e);//5
        System.out.println(f);//6
*/

        /*
        //演示--的单独使用：
        int a=5,b=5;
        a--;//相当于a=a-1
        --b;//相当于b=b-1
        System.out.println(a);//4
        System.out.println(b);//4
        System.out.println("-------");

        int c=5,d=5;
        int e =c--;
        int f =--d;
        System.out.println(c);//4
        System.out.println(d);//4
        System.out.println(e);//5
        System.out.println(f);//4

         */

        /*
        int a =10, b = 20;
        a--;
        --b;
        System.out.println(a);//19
        System.out.println(b);//19
        System.out.println("------");

        int c =10,d =20;
        int e = c--;
        int f = --d;
        System.out.println(c);//9
        System.out.println(d);//19
        System.out.println(e);//10
        System.out.println(f);//19


         */


    }
}